<?php
class Data {

	var $data = array();

	function Data($data = null, $type = "rss"){

		if(!$data) return exit;

		switch ($type) {
			case "rss" :
				$this->rss($data);
				break;
		}
	}

	function rss($rss){

		while($line = mysql_fetch_object($rss)){

			$tmp = null;

			foreach($line as $key => $value){
				$tmp[$key] = $value;
			}

			array_push($this->data, $tmp);
		}

	}

	function fetch_unique(){

		foreach($this->data as $row => $col){ 
			foreach($col as $key => $value){
				$tmp[$key] = $value;
			}
			break;
		}
		return $tmp;
	}

	function fetch_option($k, $v){
		foreach($this->data as $row => $col){
			$tmp[$col[$k]] = $col[$v];
		}
		return $tmp;
	}

	function packvar($data, $array){

	}

	function fetch(){
		return $this->data;
	}
}
?>